<!DOCTYPE html>
<html>
<head>
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache, no-store" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="shortcut icon" href="../resource/images/logo.ico" type="image/x-icon" />
<title>登录</title>
<link type="text/css" href="../resource/css/font-awesome.css" rel="stylesheet" />
<link type="text/css" href="../resource/css/gray/easyui.css" rel="stylesheet">
<link type="text/css" href="../resource/css/admin.css" rel="stylesheet" />
<script type="text/javascript" src="../resource/js/core/jquery.js"></script>
<script type="text/javascript" src="../resource/js/core/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../resource/js/core/common.js"></script>
<script type="text/javascript" src="../resource/js/core/md5.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$("#adminName").focus();
		checkBrowser();
	});
	checkBrowser = function(){
		if(!window.applicationCache) {
			$.messager.show({
				title: "提示信息",
				showType: "slide",
				msg: "当前浏览器不支持HTML5特性，可能会导致某些功能失效！<br />"
					+"建议使用谷歌浏览器(<a href=\"http://www.google.cn/intl/zh-CN/chrome/browser\">前往</a>)、火狐浏览器(<a href=\"http://www.firefox.com.cn\">前往</a>)或IE9版本以上的浏览器。"
			});
		}
	};
	login = function() {
	    var dom_mail = $("#adminName");
	    var dom_code = $("#adminCode");
		var adminName = dom_mail.val().trim();
		var adminCode = dom_code.val().trim();
		if(adminName=="") {
			$.messager.alert('提示信息', "请输入用户名！");
			dom_mail.focus();
			return;
		}
		if(adminCode.length<4) {
			$.messager.alert('提示信息', "验证码不正确！");
			dom_code.focus();
			return;
		}
		$.ajax({
			type : "post",
			url : "/pub/getLogin?t="+new Date().getTime(),
			dataType : "json",
			data: {
                mail: adminName,
				password: adminCode
			}
		}).done(function(result){
			if(result.success) {
                $.messager.alert('提示信息', result.data.tip);
				window.location.href = "/";
			} else {
				$.messager.alert('提示信息', result.message);
				dom_code.val("");
			}
		}).fail(function(){
			$.messager.alert('提示信息', "网络繁忙，请稍后再试！");
		});
	};
</script>

</head>
<body class="login-container">
	<div class="middle-login">
		<div class="block-flat">
			<div class="header">							
				<h3 class="text-center">Souche Employment</h3>
			</div>
			<div>
				<div class="content">
					<div class="form-ipt">
						<span><i class="fa-user"></i></span>
						<input id="adminName" type="text" placeholder="请输入用户名" />
					</div>
					<div style="clear: both; height: 5px;"></div>
					<div class="form-ipt">
						<span><i class="fa-ellipsis-h"></i></span>
						<input id="adminCode" type="text" placeholder="请输入邮箱验证码" maxlength="4" style="width: 190px;" />
						<button class="default" style="width:100px; height: 42px; margin-left: 10px;" type="button">获取验证码</button>
					</div>
				</div>
				<div class="foot">
					<button class="primary" type="submit" onclick="login();">登录</button>
				</div>
			</div>
		</div>
		<div class="copyright"><a href="#">©copyright souche</a></div>
	</div> 
</body>
</html>


